﻿using System;

namespace Entities
{
    [Serializable]
    public class Order
    {
        private int orderID;
        private string pasengerID;
        public Order()
        { }
        public Order(int orderID, string pasengerID)
        {
            this.orderID = orderID;
            this.pasengerID = pasengerID;
        }
        public int OrderID
        {
            get { return this.orderID; }
            set
            {
                if (value < 0)
                    throw new Exception("orderID not allow nullvalue.");
                this.orderID = value;
            }
        }
        public string PasengerID
        {
            get { return this.pasengerID; }
            set { this.pasengerID = value; }
        }
        public override string ToString()
        {
            return this.orderID + "; " + this.pasengerID + "; ";
        }
        public override bool Equals(Object obj)
        {
            Order me = (Order)obj;
            bool ret = this.OrderID.Equals(me.OrderID);
            return ret;
        }
        public override int GetHashCode()
        {
            return this.OrderID.GetHashCode();
        }

    }
}